<?php

namespace app\common\model;

use think\Model;


class ChangeImg extends Model
{

    

    

    // 表名
    protected $name = 'change_img';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];
    

    


    static function Type(){
        return [
            1   =>'浮力兑图',
            2   =>'扭蛋兑图',
//            3   =>'扭赠兑图',
        ];
    }

    static function fType(){
        return [
            101   =>'QQ空间',
            102   =>'抖音秀图',
            103   =>'小红书秀图',
        ];
    }


    static function TypeApi(){
        return [
            [
                'id'        => 1,
                'name'      => '浮力兑图',
                'child'     => self::fTypeApi()
            ],
            [
                'id'        => 2,
                'name'      => '扭蛋兑图'
            ],
//            [
//                'id'        => 3,
//                'name'      => '扭赠兑图'
//            ],
        ];
    }

    static function fTypeApi(){
        return [
            101   => [
                'name'  =>'QQ空间',
                'desc'  =>'请绑定账号，QQ空间设置所有人可进',
            ] ,
            102   => [
                'name'  =>'抖音秀图'
            ] ,
            103   => [
                'name'  => '小红书秀图'
            ] ,
        ];
    }





    public function user()
    {
        return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }

    public function product()
    {
        return $this->belongsTo('GashaponProducts', 'pro_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }
}
